<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册爬虫账号</title>
    <link type="text/css" rel="stylesheet" href="css/bootstrap.css">
    <link type="text/css" rel="stylesheet" href="css/bootstrap-theme.css">

    <script src="js/jQuery.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/jquery.easing.compatibility.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="js/jquery.nivo.slider.js"></script>

    <script src="js/jquery.validate.js"></script>
    <script src="js/additional-methods.js"></script>
    <script src="js/messages_zh.js"></script>
    <style>

        .aue {
            margin: auto 450px;
            font-size: 25px
        }

        .aa {
            margin: 20px auto 20px 450px;
            font-size: 15px
        }

        span {
            width: 80px;
            display: inline-block;
        }

        .reg input {
            width: 300px;
            height: 35px;
        }

        .reg div {
            padding: 10px 0;

        }

        .reg button {
            width: 200px;
            height: 50px;
            background-color: #9d9d9d;
        }

        .error {
            color: red;
        }

        input.error {
            border: 1px solid red;
        }
    </style>

</head>
<body>
<div class="aue"><a href="/www/main" style="text-decoration: none"><img src="99.jpg"></a></div>

<hr>
<div style="width: 1000px;height: 150px"></div>
<form class="form-horizontal" id="zc">
    <div class="reg col-md-offset-5">
        <div>
            <label>账号：</label>
            <input id="zh" name="name">
        </div>
        <div>
            <label>密码：</label>
            <input type="password" name="pwd">
        </div>

        <div style="font-size: 30px;" class="col-md-offset-1">
            <button id="regzc">注册</button>
        </div>
    </div>
</form>
<script type="text/javascript">
    $("#zc").validate({
        rules: {
            name: {
                required: true,
                rangelength: [8, 12],
            },
            pwd: {
                required: true,
                rangelength: [0, 12],
            },

        },
        messages: {
            name: {
                required: "请输入长度为8~12的账号",

            },
            pwd: {
                required: "请输入长度为0~12的密码",

            },

        }
    });
    $("#regzc").click(function () {
        var data =$("#zc").serialize(); // new FormData(document.getElementById("zc"));
        $.ajax({
            url: "/register_user",
            type: "POST",
            data: data,
            processData: false,


        });
        return false;

    });
</script>
</body>
</html>